<template>
	<view>
		<view class="wrap">
			<view class="u-tabs-box">
				<u-tabs-swiper activeColor="#A5ECFF"  ref="tabs" :list="list" :current="current" @change="change" :is-scroll="false" swiperWidth="750"></u-tabs-swiper>
			</view>
			<swiper class="swiper-box" :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish">
				<swiper-item class="swiper-item">
					<scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="reachBottom">
						<view class="order">
							<view class="item" v-for="(item, index) in goodsList" :key="index">
								<view class="content">
									<view class="title u-line-2">{{ item.title }}</view>
									<view class="type">{{item.cont}}</view>
									<view class=".delivery-time"><span style="color:#52D3EA ;margin-right: 90upx;">{{ item.type }}</span>  <span>{{ item.deliveryTime }}</span>参与</view>
						
								</view>
								<view class="left">
									<image :src="item.goodsUrl" mode="aspectFill"></image>
								</view>
							</view>
						</view>
					</scroll-view>
				</swiper-item>
				<swiper-item class="swiper-item">
					<scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="reachBottom">
						
					</scroll-view>
				</swiper-item>
				<swiper-item class="swiper-item">
					<scroll-view scroll-y style="height: 100%;width: 100%;">
						
					</scroll-view>
				</swiper-item>
				<swiper-item class="swiper-item">
					<scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="reachBottom">
						
					</scroll-view>
				</swiper-item>
			</swiper>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			orderList: [[], [], [], []],
			list: [
				{
					name: '限时一元'
				},
				{
					name: '生活健康'
				},
				{
					name: '宝宝护理'
				},
				{
					name: '宝宝喂养',
					
				}
			],
			goodsList: [{
				goodsUrl: '//img14.360buyimg.com/n7/jfs/t1/60319/15/6105/406802/5d43f68aE9f00db8c/0affb7ac46c345e2.jpg',
				title: '口腔溃疡总反复？口腔科医生来帮你',
				type: '￥1.00',
				cont: '何亮剑，浙江大学医学附属第二医院...',
				deliveryTime: '1179'
			},
			{
				goodsUrl: '//img14.360buyimg.com/n7/jfs/t1/60319/15/6105/406802/5d43f68aE9f00db8c/0affb7ac46c345e2.jpg',
				title: '口腔溃疡总反复？口腔科医生来帮你',
				type: '￥1.00',
				cont: '何亮剑，浙江大学医学附属第二医院...',
				deliveryTime: '1179'
			},
			{
				goodsUrl: '//img14.360buyimg.com/n7/jfs/t1/60319/15/6105/406802/5d43f68aE9f00db8c/0affb7ac46c345e2.jpg',
				title: '口腔溃疡总反复？口腔科医生来帮你',
				type: '￥1.00',
				cont: '何亮剑，浙江大学医学附属第二医院...',
				deliveryTime: '1179'
			},
			{
				goodsUrl: '//img14.360buyimg.com/n7/jfs/t1/60319/15/6105/406802/5d43f68aE9f00db8c/0affb7ac46c345e2.jpg',
				title: '口腔溃疡总反复？口腔科医生来帮你',
				type: '￥1.00',
				cont: '何亮剑，浙江大学医学附属第二医院...',
				deliveryTime: '1179'
			},
			{
				goodsUrl: '//img14.360buyimg.com/n7/jfs/t1/60319/15/6105/406802/5d43f68aE9f00db8c/0affb7ac46c345e2.jpg',
				title: '口腔溃疡总反复？口腔科医生来帮你',
				type: '￥1.00',
				cont: '何亮剑，浙江大学医学附属第二医院...',
				deliveryTime: '1179'
			},
			{
				goodsUrl: '//img14.360buyimg.com/n7/jfs/t1/60319/15/6105/406802/5d43f68aE9f00db8c/0affb7ac46c345e2.jpg',
				title: '口腔溃疡总反复？口腔科医生来帮你',
				type: '￥1.00',
				cont: '何亮剑，浙江大学医学附属第二医院...',
				deliveryTime: '1179'
			},
			{
				goodsUrl: '//img14.360buyimg.com/n7/jfs/t1/60319/15/6105/406802/5d43f68aE9f00db8c/0affb7ac46c345e2.jpg',
				title: '口腔溃疡总反复？口腔科医生来帮你',
				type: '￥1.00',
				cont: '何亮剑，浙江大学医学附属第二医院...',
				deliveryTime: '1179'
			}],
			current: 0,
			swiperCurrent: 0,
		
			
		};
	},
	onLoad() {
		
	},
	computed: {
	
	},
	methods: {
		reachBottom() {
			// 此tab为空数据
			// if(this.current != 2) {
			// 	this.loadStatus.splice(this.current,1,"loading")
			// 	setTimeout(() => {
			// 		this.getOrderList(this.current);
			// 	}, 1200);
			// }
		},
	
		// tab栏切换
		change(index) {
			// this.swiperCurrent = index;
			// this.getOrderList(index);
		},
		transition({ detail: { dx } }) {
			this.$refs.tabs.setDx(dx);
		},
		animationfinish({ detail: { current } }) {
			this.$refs.tabs.setFinishCurrent(current);
			this.swiperCurrent = current;
			this.current = current;
		}
	}
};
</script>

<style>
/* #ifndef H5 */
page {
	height: 100%;
	background-color: #f2f2f2;
}
/* #endif */
</style>

<style lang="scss" scoped>

.wrap {
	display: flex;
	flex-direction: column;
	height: calc(100vh - var(--window-top));
	width: 100%;
}
.swiper-box {
	flex: 1;
}
.swiper-item {
	height: 100%;
}
.order {
		background-color: #ffffff;
		margin: 0 0;

		box-sizing: border-box;
		padding: 20rpx;
		font-size: 28rpx;
		 
		border-top: 3px #f2f1f1 solid;
		border-bottom: 3px #f2f1f1 solid;

		.item {
			display: flex;
			margin: 20rpx 12rpx 0;
border-bottom:1px solid #E5E5E5;
			.left {
				margin-left: 55rpx;

				image {
					width: 180rpx;
					height: 180rpx;
					border-radius: 10rpx;
				}
			}

			.content {
				margin-left: 2rpx;

				.title {
					font-size: 28rpx;
					line-height: 50rpx;
				}

				.type {
					margin: 30rpx 0;
					font-size: 24rpx;
					color: #505050;
				}

				.delivery-time {
					margin: 5rpx 0;
					color: #505050;
					font-size: 24rpx;
					display: flex;
					justify-content: center;
				}
			}

		}
	}
</style>
